package org.csu.wuliu.service;

import org.csu.wuliu.domain.MainWarehouse;
import org.csu.wuliu.domain.Request;
import org.csu.wuliu.persistence.MainWarehouseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MainWarehouseService {
    @Autowired
    private MainWarehouseMapper mainWarehouseMapper;


    public MainWarehouse getWarehouse(int WHID) {

        return mainWarehouseMapper.getWarehouse(WHID);
    }

    //    @Transactional
    public List<Request> viewRequest() {
        return mainWarehouseMapper.getRequestList();
    }

    public List<Request> viewHistory() {
        return mainWarehouseMapper.getHistoryList();
    }

    public void agree(Request request) {
        mainWarehouseMapper.agree(request);
    }


    public void reject(Request request) {
        mainWarehouseMapper.reject(request);
    }
}
